import request from '@/utils/request'
import store from '@/store/index'

export const login = data => {
  return request({
    url: '/v1_0/authorizations',
    method: 'POST',
    data, //post 请求  传参数放在post 中 get 放在parms
  })
}
// 登录
export const getSmsCode = mobile => {
  return request({
    url: `/v1_0/sms/codes/${mobile}`,
  })
}

// 获取用户信息
export const getUserInfo = () => {
  return request({
    url: '/v1_0/user',
    headers: {
      Authorization: `Bearer ${store.state.user.token}`,
    },
  })
}
